package com.example.job.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.job.po.SysJob;
import com.example.job.quartz.Job;

import java.util.Date;
import java.util.List;

/**
 * @author chentao
 * @version 1.0
 * @description: TODO
 * @date 2025/3/26 下午11:04
 */
public interface SysJobService extends IService<SysJob> {

    public List<SysJob> selectJobList(Date runTime);

    public Date selectNextRunTime(Date time);

    public SysJob addJob(String name, int minute, Job job, boolean autoDelete, String context) throws Exception;

    public SysJob addJob(String name, String cron, Job job, Date nextTime, boolean autoDelete, String context) throws Exception;

    public void updateJob(SysJob sysJob) throws Exception;

    public void cancelJob(Long id) throws Exception;

    public String getCron(Date date);
}
